Left Termination of the query pattern d_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

d(X, X, 1).
d(T, X, 0) :- isnumber(T).
d(times(U, V), X, +(times(B, U), times(A, V))) :- ','(d(U, X, A), d(V, X, B)).
d(div(U, V), X, W) :- d(times(U, power(V, p(0))), X, W).
d(power(U, V), X, times(V, times(W, power(U, p(V))))) :- ','(isnumber(V), d(U, X, W)).
isnumber(0).
isnumber(s(X)) :- isnumber(X).
isnumber(p(X)) :- isnumber(X).

Queries:

d(g,g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

D_IN(power(U, V), X, times(V, times(W, power(U, p(V))))) → U51(U, V, X, W, isnumber_in(V))
D_IN(power(U, V), X, times(V, times(W, power(U, p(V))))) → ISNUMBER_IN(V)
ISNUMBER_IN(p(X)) → U81(X, isnumber_in(X))
ISNUMBER_IN(p(X)) → ISNUMBER_IN(X)
ISNUMBER_IN(s(X)) → U71(X, isnumber_in(X))
ISNUMBER_IN(s(X)) → ISNUMBER_IN(X)
U51(U, V, X, W, isnumber_out(V)) → U61(U, V, X, W, d_in(U, X, W))
U51(U, V, X, W, isnumber_out(V)) → D_IN(U, X, W)
D_IN(div(U, V), X, W) → U41(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
D_IN(div(U, V), X, W) → D_IN(times(U, power(V, p(0))), X, W)
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → U21(U, V, X, B, A, d_in(U, X, A))
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → D_IN(U, X, A)
D_IN(T, X, 0) → U11(T, X, isnumber_in(T))
D_IN(T, X, 0) → ISNUMBER_IN(T)
U21(U, V, X, B, A, d_out(U, X, A)) → U31(U, V, X, B, A, d_in(V, X, B))
U21(U, V, X, B, A, d_out(U, X, A)) → D_IN(V, X, B)

The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)
U71(x1, x2)  =  U71(x2)
ISNUMBER_IN(x1)  =  ISNUMBER_IN(x1)
U51(x1, x2, x3, x4, x5)  =  U51(x1, x2, x3, x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U81(x1, x2)  =  U81(x2)
D_IN(x1, x2, x3)  =  D_IN(x1, x2)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x1, x2, x3, x6)
U61(x1, x2, x3, x4, x5)  =  U61(x1, x2, x5)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x5, x6)
U11(x1, x2, x3)  =  U11(x3)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

D_IN(power(U, V), X, times(V, times(W, power(U, p(V))))) → U51(U, V, X, W, isnumber_in(V))
D_IN(power(U, V), X, times(V, times(W, power(U, p(V))))) → ISNUMBER_IN(V)
ISNUMBER_IN(p(X)) → U81(X, isnumber_in(X))
ISNUMBER_IN(p(X)) → ISNUMBER_IN(X)
ISNUMBER_IN(s(X)) → U71(X, isnumber_in(X))
ISNUMBER_IN(s(X)) → ISNUMBER_IN(X)
U51(U, V, X, W, isnumber_out(V)) → U61(U, V, X, W, d_in(U, X, W))
U51(U, V, X, W, isnumber_out(V)) → D_IN(U, X, W)
D_IN(div(U, V), X, W) → U41(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
D_IN(div(U, V), X, W) → D_IN(times(U, power(V, p(0))), X, W)
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → U21(U, V, X, B, A, d_in(U, X, A))
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → D_IN(U, X, A)
D_IN(T, X, 0) → U11(T, X, isnumber_in(T))
D_IN(T, X, 0) → ISNUMBER_IN(T)
U21(U, V, X, B, A, d_out(U, X, A)) → U31(U, V, X, B, A, d_in(V, X, B))
U21(U, V, X, B, A, d_out(U, X, A)) → D_IN(V, X, B)

The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)
U71(x1, x2)  =  U71(x2)
ISNUMBER_IN(x1)  =  ISNUMBER_IN(x1)
U51(x1, x2, x3, x4, x5)  =  U51(x1, x2, x3, x5)
U41(x1, x2, x3, x4, x5)  =  U41(x5)
U81(x1, x2)  =  U81(x2)
D_IN(x1, x2, x3)  =  D_IN(x1, x2)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x1, x2, x3, x6)
U61(x1, x2, x3, x4, x5)  =  U61(x1, x2, x5)
U31(x1, x2, x3, x4, x5, x6)  =  U31(x1, x2, x5, x6)
U11(x1, x2, x3)  =  U11(x3)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 8 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNUMBER_IN(s(X)) → ISNUMBER_IN(X)
ISNUMBER_IN(p(X)) → ISNUMBER_IN(X)

The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)
ISNUMBER_IN(x1)  =  ISNUMBER_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

ISNUMBER_IN(s(X)) → ISNUMBER_IN(X)
ISNUMBER_IN(p(X)) → ISNUMBER_IN(X)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

ISNUMBER_IN(s(X)) → ISNUMBER_IN(X)
ISNUMBER_IN(p(X)) → ISNUMBER_IN(X)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U21(U, V, X, B, A, d_out(U, X, A)) → D_IN(V, X, B)
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → D_IN(U, X, A)
D_IN(div(U, V), X, W) → D_IN(times(U, power(V, p(0))), X, W)
D_IN(power(U, V), X, times(V, times(W, power(U, p(V))))) → U51(U, V, X, W, isnumber_in(V))
D_IN(times(U, V), X, +(times(B, U), times(A, V))) → U21(U, V, X, B, A, d_in(U, X, A))
U51(U, V, X, W, isnumber_out(V)) → D_IN(U, X, W)

The TRS R consists of the following rules:

d_in(power(U, V), X, times(V, times(W, power(U, p(V))))) → U5(U, V, X, W, isnumber_in(V))
isnumber_in(p(X)) → U8(X, isnumber_in(X))
isnumber_in(s(X)) → U7(X, isnumber_in(X))
isnumber_in(0) → isnumber_out(0)
U7(X, isnumber_out(X)) → isnumber_out(s(X))
U8(X, isnumber_out(X)) → isnumber_out(p(X))
U5(U, V, X, W, isnumber_out(V)) → U6(U, V, X, W, d_in(U, X, W))
d_in(div(U, V), X, W) → U4(U, V, X, W, d_in(times(U, power(V, p(0))), X, W))
d_in(times(U, V), X, +(times(B, U), times(A, V))) → U2(U, V, X, B, A, d_in(U, X, A))
d_in(T, X, 0) → U1(T, X, isnumber_in(T))
U1(T, X, isnumber_out(T)) → d_out(T, X, 0)
d_in(X, X, 1) → d_out(X, X, 1)
U2(U, V, X, B, A, d_out(U, X, A)) → U3(U, V, X, B, A, d_in(V, X, B))
U3(U, V, X, B, A, d_out(V, X, B)) → d_out(times(U, V), X, +(times(B, U), times(A, V)))
U4(U, V, X, W, d_out(times(U, power(V, p(0))), X, W)) → d_out(div(U, V), X, W)
U6(U, V, X, W, d_out(U, X, W)) → d_out(power(U, V), X, times(V, times(W, power(U, p(V)))))

The argument filtering Pi contains the following mapping:
d_in(x1, x2, x3)  =  d_in(x1, x2)
power(x1, x2)  =  power(x1, x2)
times(x1, x2)  =  times(x1, x2)
p(x1)  =  p(x1)
U5(x1, x2, x3, x4, x5)  =  U5(x1, x2, x3, x5)
isnumber_in(x1)  =  isnumber_in(x1)
U8(x1, x2)  =  U8(x2)
s(x1)  =  s(x1)
U7(x1, x2)  =  U7(x2)
0  =  0
isnumber_out(x1)  =  isnumber_out
U6(x1, x2, x3, x4, x5)  =  U6(x1, x2, x5)
div(x1, x2)  =  div(x1, x2)
U4(x1, x2, x3, x4, x5)  =  U4(x5)
+(x1, x2)  =  +(x1, x2)
U2(x1, x2, x3, x4, x5, x6)  =  U2(x1, x2, x3, x6)
U1(x1, x2, x3)  =  U1(x3)
d_out(x1, x2, x3)  =  d_out(x3)
1  =  1
U3(x1, x2, x3, x4, x5, x6)  =  U3(x1, x2, x5, x6)
U51(x1, x2, x3, x4, x5)  =  U51(x1, x2, x3, x5)
D_IN(x1, x2, x3)  =  D_IN(x1, x2)
U21(x1, x2, x3, x4, x5, x6)  =  U21(x1, x2, x3, x6)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

D_IN(times(U, V), X) → U21(U, V, X, d_in(U, X))
U21(U, V, X, d_out(A)) → D_IN(V, X)
U51(U, V, X, isnumber_out) → D_IN(U, X)
D_IN(div(U, V), X) → D_IN(times(U, power(V, p(0))), X)
D_IN(power(U, V), X) → U51(U, V, X, isnumber_in(V))
D_IN(times(U, V), X) → D_IN(U, X)

The TRS R consists of the following rules:

d_in(power(U, V), X) → U5(U, V, X, isnumber_in(V))
isnumber_in(p(X)) → U8(isnumber_in(X))
isnumber_in(s(X)) → U7(isnumber_in(X))
isnumber_in(0) → isnumber_out
U7(isnumber_out) → isnumber_out
U8(isnumber_out) → isnumber_out
U5(U, V, X, isnumber_out) → U6(U, V, d_in(U, X))
d_in(div(U, V), X) → U4(d_in(times(U, power(V, p(0))), X))
d_in(times(U, V), X) → U2(U, V, X, d_in(U, X))
d_in(T, X) → U1(isnumber_in(T))
U1(isnumber_out) → d_out(0)
d_in(X, X) → d_out(1)
U2(U, V, X, d_out(A)) → U3(U, V, A, d_in(V, X))
U3(U, V, A, d_out(B)) → d_out(+(times(B, U), times(A, V)))
U4(d_out(W)) → d_out(W)
U6(U, V, d_out(W)) → d_out(times(V, times(W, power(U, p(V)))))

The set Q consists of the following terms:

d_in(x0, x1)
isnumber_in(x0)
U7(x0)
U8(x0)
U5(x0, x1, x2, x3)
U1(x0)
U2(x0, x1, x2, x3)
U3(x0, x1, x2, x3)
U4(x0)
U6(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U21(U, V, X, d_out(A)) → D_IN(V, X)
U51(U, V, X, isnumber_out) → D_IN(U, X)
D_IN(div(U, V), X) → D_IN(times(U, power(V, p(0))), X)
D_IN(power(U, V), X) → U51(U, V, X, isnumber_in(V))
D_IN(times(U, V), X) → D_IN(U, X)
The remaining pairs can at least be oriented weakly.

D_IN(times(U, V), X) → U21(U, V, X, d_in(U, X))
Used ordering: Combined order from the following AFS and order.
D_IN(x1, x2)  =  x1
times(x1, x2)  =  times(x1, x2)
U21(x1, x2, x3, x4)  =  U21(x2, x4)
d_in(x1, x2)  =  x1
d_out(x1)  =  d_out
U51(x1, x2, x3, x4)  =  U51(x1, x2, x4)
isnumber_out  =  isnumber_out
div(x1, x2)  =  div(x1, x2)
power(x1, x2)  =  power(x1, x2)
p(x1)  =  p(x1)
0  =  0
isnumber_in(x1)  =  x1
U1(x1)  =  x1
U5(x1, x2, x3, x4)  =  U5(x1, x2)
U6(x1, x2, x3)  =  U6(x1, x2, x3)
U4(x1)  =  x1
U7(x1)  =  U7
U3(x1, x2, x3, x4)  =  x2
+(x1, x2)  =  +
U2(x1, x2, x3, x4)  =  U2(x2)
U8(x1)  =  U8(x1)
1  =  1
s(x1)  =  s

Recursive path order with status [2].
Quasi-Precedence:
div2 > [times2, U2^12] > U21 > [dout, U81]
div2 > power2 > U5^13 > [dout, U81]
div2 > power2 > U52 > [isnumberout, 0, U63, U7, s] > p1 > [dout, U81]
+ > [dout, U81]
1 > [dout, U81]

Status:
isnumberout: multiset
power2: multiset
0: multiset
s: []
times2: [2,1]
U5^13: multiset
div2: [1,2]
U52: multiset
U7: []
U63: multiset
U81: multiset
+: []
1: multiset
U2^12: [1,2]
dout: []
p1: [1]
U21: multiset


The following usable rules [17] were oriented:

U1(isnumber_out) → d_out(0)
d_in(power(U, V), X) → U5(U, V, X, isnumber_in(V))
U6(U, V, d_out(W)) → d_out(times(V, times(W, power(U, p(V)))))
isnumber_in(0) → isnumber_out
d_in(div(U, V), X) → U4(d_in(times(U, power(V, p(0))), X))
d_in(T, X) → U1(isnumber_in(T))
U4(d_out(W)) → d_out(W)
U7(isnumber_out) → isnumber_out
U3(U, V, A, d_out(B)) → d_out(+(times(B, U), times(A, V)))
d_in(times(U, V), X) → U2(U, V, X, d_in(U, X))
U2(U, V, X, d_out(A)) → U3(U, V, A, d_in(V, X))
U8(isnumber_out) → isnumber_out
isnumber_in(p(X)) → U8(isnumber_in(X))
d_in(X, X) → d_out(1)
U5(U, V, X, isnumber_out) → U6(U, V, d_in(U, X))
isnumber_in(s(X)) → U7(isnumber_in(X))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

D_IN(times(U, V), X) → U21(U, V, X, d_in(U, X))

The TRS R consists of the following rules:

d_in(power(U, V), X) → U5(U, V, X, isnumber_in(V))
isnumber_in(p(X)) → U8(isnumber_in(X))
isnumber_in(s(X)) → U7(isnumber_in(X))
isnumber_in(0) → isnumber_out
U7(isnumber_out) → isnumber_out
U8(isnumber_out) → isnumber_out
U5(U, V, X, isnumber_out) → U6(U, V, d_in(U, X))
d_in(div(U, V), X) → U4(d_in(times(U, power(V, p(0))), X))
d_in(times(U, V), X) → U2(U, V, X, d_in(U, X))
d_in(T, X) → U1(isnumber_in(T))
U1(isnumber_out) → d_out(0)
d_in(X, X) → d_out(1)
U2(U, V, X, d_out(A)) → U3(U, V, A, d_in(V, X))
U3(U, V, A, d_out(B)) → d_out(+(times(B, U), times(A, V)))
U4(d_out(W)) → d_out(W)
U6(U, V, d_out(W)) → d_out(times(V, times(W, power(U, p(V)))))

The set Q consists of the following terms:

d_in(x0, x1)
isnumber_in(x0)
U7(x0)
U8(x0)
U5(x0, x1, x2, x3)
U1(x0)
U2(x0, x1, x2, x3)
U3(x0, x1, x2, x3)
U4(x0)
U6(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.